package com.dwxt.cdms.api.service.impl;



import com.dwxt.cdms.api.service.ServiceService;
import com.dwxt.cdms.dao.info.ServiceMapper;
import com.dwxt.cdms.entity.info.ServiceDto;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ServiceServiceImpl implements ServiceService {

    @Autowired
    private ServiceMapper serviceMapper;

    @Override
    public int insert(ServiceDto service) {

        return serviceMapper.insertSelective(service);
    }

    @Override
    public int update(ServiceDto service) {

        return serviceMapper.updateByPrimaryKeySelective(service);
    }

    @Override
    public int delete(String id) {
        return serviceMapper.deleteByPrimaryKey(id);
    }

    @Override
    public ServiceDto selectById(String id) {
        return serviceMapper.selectByPrimaryKey(id);
    }

    @Override
    public List<ServiceDto> selectByObj() {

        return serviceMapper.getServiceList();
    }

    @Override
    public List<ServiceDto> getServiceListByType(String typeId) {
        return serviceMapper.getServiceListByType(typeId);
    }
}
